package com.acwer.drools.conf;

import java.util.logging.Logger;

import org.drools.core.process.instance.WorkItemHandler;
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemManager;



/**
 * drools flow 日志实现
 * @author ZhaoJie
 *
 */
 
public class LoggingWorkItemHandler implements WorkItemHandler {
	
	private static final Logger logger = Logger.getLogger(LoggingWorkItemHandler.class.getName());



	public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
		logger.info(workItem.getParameter("Message").toString());
		manager.completeWorkItem(workItem.getId(), null);
	}

	public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
		manager.abortWorkItem(workItem.getId());
		
	}
			
	
 
}